<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\widgets\avatar\AvatarWidget;
use common\widgets\avatar\AvatarViewWidget;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \frontend\models\SignupForm */
?>

<div class="site-signup">
    <p>Please fill out the following fields to create:</p>
    <div class="row">
        <div class="col-lg-5">
            <?= AvatarWidget::widget(['imageUrl'=>'']); ?>
            <?php $form = ActiveForm::begin(['id' => 'form-signup']); ?>

            <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>

            <?= $form->field($model, 'password') ?>

            <?= $form->field($model, 'avatar')->widget(AvatarViewWidget::className(),['imageUrl'=>'']) ?>

            <div class="form-group">
                <?php //Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'signup-button']) ?>
                <?= Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
            </div>

            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>
<script>
    userAspectRatio = 1;
</script>